﻿using System.IO;
using System.Xml;

namespace Objectware.Silverlight.Testing.Runner
{
	public class ExecutionManager
	{
		public static readonly ExecutionManager Instance = new ExecutionManager();

		private ExecutionManager()
		{
			this.Initialize();
		}

		private void Initialize()
		{
		}

		private static void Log(string format, params object[] parameters)
		{
			//File.AppendAllText("c:\\executionmanager.log", string.Format("{0}\n\r", string.Format(format, parameters)));
		}

		public void Run(TestHarness harness)
		{
			Log("Run()");

			ServerManager.Instance.ClearTestDirectory();
			ServerManager.Instance.PrepareTestDirectory(harness);
			ServerManager.Instance.PrepareTestRunner(harness);
			
			ExecutionForm.RunTests(harness);
		}

		

	}
}

